           package com.java.diagnostics.visualizer.displayer.plot;
           
           import com.java.diagnostics.visualizer.impl.factory.LogFactory;
           import com.java.diagnostics.visualizer.properties.OutputProperties;
           import java.util.logging.Logger;
           
           public class ZoomingXPositionConverter extends XPositionConverter
           {
             private static final Logger TRACE = LogFactory.getTrace(ZoomingXPositionConverter.class);
             private OutputProperties properties;
           
             public ZoomingXPositionConverter(OutputProperties properties)
             {
               this.properties = properties;
             }
           
             protected void calculateDeltas() {
               double xZoomStart = this.properties.getXZoomStart();
               double xZoomEnd = this.properties.getXZoomEnd();
               double range = this.max - this.min;
               this.delta = (range * (xZoomEnd - xZoomStart));
           
               this.lowerLimit = (this.min + range * xZoomStart);
           
               this.delta += 1.0E-007D;
             }
           
             public double getAsZoomFraction(int position)
             {
               double xZoomStart = this.properties.getXZoomStart();
               double xZoomEnd = this.properties.getXZoomEnd();
               double currentZoomWidth = xZoomEnd - xZoomStart;
           
               double newXZoomFraction = (position - this.plotLeft) / this.plotWidth;
           
               newXZoomFraction = xZoomStart + newXZoomFraction * currentZoomWidth;
           
               return newXZoomFraction;
             }
           }

